package com.umeng.analytics.pro;

import com.umeng.analytics.AnalyticsConfig;

public class as implements Thread.UncaughtExceptionHandler {
    private Thread.UncaughtExceptionHandler a;
    private ay b;

    public as() {

        if(Thread.getDefaultUncaughtExceptionHandler() != this) {
            this.a = Thread.getDefaultUncaughtExceptionHandler();
            Thread.setDefaultUncaughtExceptionHandler(((Thread.UncaughtExceptionHandler)this));
        }
    }

    public void a(ay arg1) {
        this.b = arg1;
    }

    private void a(Throwable arg3) {
        if(AnalyticsConfig.CATCH_EXCEPTION) {
            this.b.a(arg3);
        }
        else {
            this.b.a(null);
        }
    }

    public void uncaughtException(Thread arg3, Throwable arg4) {
        this.a(arg4);
        if(this.a != null && this.a != Thread.getDefaultUncaughtExceptionHandler()) {
            this.a.uncaughtException(arg3, arg4);
        }
    }
}

